package no.ffi.gismoidm.attrex;

import java.util.Properties;

/**
 *
 * @author anders
 */
public class GreaterThan extends BooleanOperator {
    
    AttributeOperand op1;
    NumberOperand op2;

    public GreaterThan(AttributeOperand op1, NumberOperand op2) {
        this.op1 = op1;
        this.op2 = op2;
    }

   // Utility method for short hand use
    public GreaterThan(String key, String value) {
        this(new AttributeOperand(key), new IntegerOperand(value));
    }
    
    public GreaterThan(String key, Integer value) {
        this(new AttributeOperand(key), new IntegerOperand(value));
    }

    public BooleanValue getBooleanValue(Properties attributes) throws AttributeEvaluationException {
        return new BooleanValue(op1.greaterThan(op2,attributes));
    }

    public String toString() {
        return "gt(" + op1.toString() + "," + op2.toString() + ")";
    }
    
}
